//
//  LCZSonCollectionViewCell.m
//  PersonalNews
//
//  Created by Golibyo on 15/11/27.
//  Copyright © 2015年 changshuhua. All rights reserved.
//

#import "LCZSonCollectionViewCell.h"

@implementation LCZSonCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.label = [[LCZBaseLabel alloc] init];
        self.detailLabel = [[LCZBaseLabel alloc] init];
        self.numberLabel = [[LCZBaseLabel alloc] init];
        self.myImageView = [[LCZBaseImageView alloc] init];
        
        
        [self.contentView addSubview:self.label];
        [self.contentView addSubview:self.detailLabel];
        [self.contentView addSubview:self.numberLabel];
        [self.contentView addSubview:self.myImageView];
        self.myImageView.layer.masksToBounds = YES;
        self.myImageView.layer.cornerRadius = (self.contentView.frame.size.width - 20) / 2.0;
        
        self.label.font = [UIFont systemFontOfSize:12];
        self.detailLabel.font = [UIFont systemFontOfSize:12];
        self.label.textAlignment = NSTextAlignmentCenter;
        self.detailLabel.textAlignment = NSTextAlignmentCenter;
        self.detailLabel.numberOfLines = 0;
        self.numberLabel.textAlignment = NSTextAlignmentCenter;
        self.numberLabel.font = [UIFont systemFontOfSize:12];
        
        [self.myImageView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self).with.offset(10);
            make.centerX.equalTo(self.mas_centerX);
            make.width.height.mas_equalTo(self.contentView.frame.size.width - 20);
        }];
        [self.label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.myImageView.mas_bottom).with.offset(10);
            make.height.mas_equalTo(20);
            make.left.equalTo(self).with.offset(15);
            make.right.equalTo(self).with.offset(- 15);
        }];
        [self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.label.mas_bottom).with.offset(10);
            make.left.equalTo(self).with.offset(15);
            make.height.mas_equalTo(40);
            make.right.equalTo(self).with.offset(- 15);
        }];
        [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.detailLabel.mas_bottom).with.offset(5);
            make.left.equalTo(self).with.offset(15);
            make.right.equalTo(self).with.offset(- 15);
            make.height.mas_equalTo(15);
        }];
        
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
